<!--
  @author hedaiping
  @since 2019/3/26
-->
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-4.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">

<head th:include="common/common :: jscss">
    <title>新增或编辑分类</title>
</head>
<body>
<div class="layui-fluid">

    <blockquote class="layui-crumb">系统管理>
        <a lay-href="/funswitch/list.action">公共配置</a>>
        <zmn th:text="${(codeMap.mapId == 0 || codeMap.mapId == null ) ? '新增配置' : codeMap.name}"></zmn>
    </blockquote>

    <div class="layui-card">
        <form method="post" action="" class="layui-form" lay-filter="zmn-funswitch-form">
            <input type="hidden" name="mapId" th:value="${codeMap.mapId}"/>

            <div class="layui-card-header" style="margin-top:10px;"><b>基本信息</b></div>
            <div class="layui-split">&nbsp;</div>

            <div class="layui-form-item">
                <label class="layui-form-label layui-form-required">名称</label>
                <div class="layui-input-inline" style="width:400px;">
                    <input type="text" name="name" lay-verify="required" th:value="${codeMap.name}"
                           autocomplete="off" class="layui-input" maxlength="490"/>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label layui-form-required">平台</label>
                <div class="layui-input-inline">
                    <select name="plat">
                        <option th:each="plat:${plats}" th:value="${plat.key}" th:text="${plat.value}" th:selected="${plat.key == codeMap.plat}">
                    </select>
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">一级类别Id</label>
                <div class="layui-input-inline" style="width:400px;">
                    <input type="text" name="onetypeId" lay-verify="onetypeId" th:value="${codeMap.oneTypeId}" autocomplete="off" class="layui-input" maxlength="45"/>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">二级类别Id</label>
                <div class="layui-input-inline" style="width:400px;">
                    <input type="text" name="twoTypeId" lay-verify="twoTypeId" th:value="${codeMap.twoTypeId}" autocomplete="off" class="layui-input" maxlength="45"/>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">三级类别Id</label>
                <div class="layui-input-inline" style="width:400px;">
                    <input type="text" name="threeTypeId" lay-verify="threeTypeId" th:value="${codeMap.threeTypeId}" autocomplete="off" class="layui-input" maxlength="45"/>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label layui-form-required">状态</label>
                <div class="layui-input-inline">
                    <select name="status">
                        <option th:each="status:${statuses}" th:value="${status.key}" th:text="${status.value}" th:selected="${status.key == codeMap.status}">
                    </select>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">备注</label>
                <div class="layui-input-inline">
                    <textarea th:text="${codeMap.desc}" style="width: 600px; min-height:120px;"
                              name="desc" class="layui-textarea" maxlength="500">
                    </textarea>
                </div>
            </div>

            <zmn th:if="${codeMap.mapId > 0}">
                <div class="layui-card-header"><b>其他信息</b></div>
                <div class="layui-split">&nbsp;</div>
                    <div class="layui-form-item layui-form-item-xs">
                        <label class="layui-form-label">修改人/时间</label>
                        <div class="layui-input-block">
                            <div class="layui-form-mid layui-word-aux" th:text="${codeMap.updater} + '&nbsp;/&nbsp;' + ${#dates.format(codeMap.updateTime, 'yyyy-MM-dd HH:mm:ss')}">修改人/时间</div>
                        </div>
                    </div>
                <div class="layui-form-item layui-form-item-xs">
                    <label class="layui-form-label">创建人/时间</label>
                    <div class="layui-input-block">
                        <div class="layui-form-mid layui-word-aux" th:text="${codeMap.creater} + '&nbsp;/&nbsp;' + ${#dates.format(codeMap.createTime, 'yyyy-MM-dd HH:mm:ss')}">创建人/时间</div>
                    </div>
                </div>
            </zmn>

            <div class="layui-split">&nbsp;</div>
            <div class="layui-form-item layui-layout-admin">
                <div class="layui-input-block">
                    <div class="layui-footer" style="left: 0;">
                        <button class="layui-btn" lay-submit="" lay-filter="zmn-funswitch-form-submit" th:if="${#authPermit.checkPermit('/funswitch/addEdit.action')}">保存</button>
                        <button class="layui-btn layui-btn-primary" onclick="parent.layui.element.tabDelete('layadmin-layout-tabs', window.location.pathname + window.location.search)">取消</button>
                    </div>
                </div>
            </div>

        </form>

    </div>

</div>

<script type="text/javascript" th:inline="javascript">

    layui.config({
        base: "/static/lay/"
    }).extend({
        index: "lib/index",
        art_funswitch_detail: "funswitch/zmn.art.funswitch.edit"
    }).use(['index', 'art_funswitch_detail']);

</script>
</body>
</html>